<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: relative;
            width: 300px;
            height: 200px;
            margin: 100px auto;
            border: 1px solid #999;
            text-align: center;
        }

        .box img {
            width: 280px;
            height: 170px;

        }

        .box i {
            position: absolute;
            width: 20px;
            height: 20px;
            left: -21px;
            top: -1px;
            border: 1px solid #999;
            border-right: none;
            font-family: Arial, Helvetica, sans-serif;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div class="box">
        非正规广告
        <img src="img/200H3121005-4.jpg" alt="">
        <i>x</i>
    </div>

    <script>
        var box = document.querySelector('div')
        var i = document.querySelector('i')

        i.onclick = function () {
            box.style.display = 'none';
        }

    </script>
</body>

</html>